<%@ page language="java" pageEncoding="UTF-8"%>
<%@ include file="../back-common.jsp"%>
<%@ include file="/WEB-INF/pages/common/taglib.jsp"%>
 <%@ include file="/WEB-INF/pages/common/back-dialog.jsp"%>

<%@ taglib uri="http://displaytag.sf.net" prefix="display"%>
<%
			Long offset = (Long)request.getAttribute("offset");
%>
    
    <!-- 标题 -->
    <table class="${tableclass}" style="width: 100%">
	    <thead>
	    	<tr>
	    		<th><strong class="am-text-primary am-text-lg">系统管理</strong> /  登录配置</th>
	    	</tr>
	    </thead>
   	</table>
   
    <!-- tab -->
    <div style="margin-left: 0.5rem">
		<div class="seller_list_title">
          <ul class="seller_title_ul am-tabs-nav am-nav am-nav-tabs">
          	 <li class="am-active"><i></i><a href="<ls:url address='/admin/system/systemParameter/query/ln_model'/>">登录方式配置</a></li>
         	 <li><i></i><a href="<ls:url address='/admin/system/systemParameter/query/ln'/>">登录参数配置</a></li>
         </ul>
        </div>
   </div>
   
   
    <!-- 数据表格 -->
    <div align="center">
       <%@ include file="/WEB-INF/pages/common/messages.jsp"%>
       
       <display:table name="list" requestURI="/admin/secDomainName/query" id="item"
         export="false" class="${tableclass}" style="width:100%" sort="external">
         
	       <display:column title="顺序"  style="min-width:50px;"><%=offset++%></display:column>
		   <display:column title="登录方式">
				${item.memo}
		   </display:column>
		   <display:column title="状态">
				<c:if test="${item.value eq true}"><span style="color:green">已开启</span></c:if>
				<c:if test="${item.value eq false}"><span style="color:red">已禁用</span></c:if>
		   </display:column>
	   
		  <!-- 操作列按钮 -->   
	      <display:column title="操作" media="html"   style="width: 250px;">
		  	  <c:if test="${item.value eq false}"><a href="javascript:isEnable('${item.name }',true)" >开启</a></c:if>
              <c:if test="${item.value eq true}"><a href="javascript:isEnable('${item.name }',false)">禁用</a></c:if>
	      </display:column>
	 </display:table>
	 
    <ls:page pageSize="${pageSize }"  total="${total}" curPageNO="${curPageNO }"  type="default"/>
 </div>
 
 <script type="text/javascript">
 	var contextPath = '${contextPath}';
 	
 	 //删除二级域名
 	function isEnable(name,flag){
 			var msg = "确定开启?";
 			if(!flag){
 				msg = "确定禁用?";
 			}
 		art.dialog.confirm(msg, function () {
 			$.ajax({
				 type: "POST",
				 url: contextPath+"/admin/system/systemParameter/save",
				 data:{"name":name,"value":flag},
				 async : false, 
				 error:function(data){
				   art.dialog.tips("恭喜您,操作失败!");
				 },   
				 success:function(data){
					window.location = contextPath+"/admin/system/systemParameter/query/ln_model";
					art.dialog.tips("恭喜您,操作成功!");
				}
			});
 		});
 	}
 </script>
